﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Baimasoft.FrameWork.Base;
using Baimasoft.Manage.SqlServerDAL;

public partial class BBS_Board : Baimasoft.Web.UI.PageManagerTop 
{
    public static string SID, SName, AID;
    public string usercookies;
    public string OAName;
    public string UserName;
    Articles MyAC = new Articles();

    protected void Page_Load(object sender, EventArgs e)
    {
        this.BindControlEvent();
        if (!this.IsPostBack)
        {
            GridView1.Attributes.Add("BorderColor", "LightSkyBlue");

            if (Session["Baimasoft_User_LogonID"] != null)
            {
                usercookies = (string)Session["Baimasoft_User_LogonID"];
            }
            try
            {
                SID = Request.QueryString["SectionID"].ToString().Trim();
                SName = Request.QueryString["SectionName"].ToString().Trim();
            }
            catch
            {
                Response.Write("参数传递错误！");
                Response.End();
            }
            BindGridViewData();

           
        }
    }

    protected override void BindGridViewData()
    {
        this.DataSource = MyAC.GetSectionInfo(SID);
        this.DataSource.DefaultView.Sort = this.SortString;
        GridView1.DataSource = this.DataSource.DefaultView;
        GridView1.DataBind();
    }
    protected void NewTopic_Click(object sender, ImageClickEventArgs e)
    {
        if (Session["Baimasoft_User_LogonID"] == null)
        {
            Page.RegisterStartupScript("", "<script>alert('对不起！您还未登陆或注册本论坛！');<" + "/script>");
            BindGridViewData();
        }
        else
        {
            Response.Redirect("NewTopic.aspx?SectionID=" + Request.QueryString["SectionID"].ToString().Trim() + "&SectionName=" + Request.QueryString["SectionName"].ToString().Trim());
        }
    }
}
